package com.example.menhoo.toollibrary.common.utils;

import android.content.Context;
import android.media.AudioManager;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.media.SoundPool;
import android.net.Uri;

public class SoundUtil {

    public static void play(Context context){
        Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
        Ringtone r = RingtoneManager.getRingtone(context, notification);
        r.play();
    }

    public static void play(Context context, int Rid){
        SoundPool soundPool;
        soundPool= new SoundPool(1,AudioManager.STREAM_SYSTEM, 5);
        soundPool.load(context, Rid,1);
        soundPool.play(1,1, 1, 0, 0, 1);
    }

}
